#include <cstdio>
#define N 1000
using namespace std;
struct Edge {
	int v, nxt;
} e[N << 1];

int n, cnt;
int heads[N];
inline void add(int u, int v) {
	e[++cnt].v = v;
	e[cnt].nxt = heads[u];
	heads[u] = cnt;
}
int size[N], fa[N];
void dfs(int cur) {
	for (int i = heads[cur]; i; i = e[i].nxt) {
		if (e[i].v == cur)
			continue;
		
	}
}
int main() {
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
	scanf("%d", &n);
	int tmp1, tmp2;
	for (int i = 1; i < n; ++i) {
		scanf("%d %d", &tmp1, &tmp2);
		add(tmp1, tmp2);
		add(tmp2, tmp1);
	}

	fclose(stdin);
	fclose(stdout);
	return 0;
}